<h1>Список игроков</h1>

<% if @players.empty?%>
    <p> Зарегестированных игроков нет </p>
<% else %>
<table>
  <tr>
  <% for column in Player.sem_content_columns %>
    <th align="left"><%= translate(column.humanize(),@lang) %></th>
  <% end %>
  </tr>
  
<% for player in @players %>
  <tr>
  <% for column in Player.sem_content_columns %>
    <td><%=h translate(player.send(column),@lang) %></td>
  <% end %>
    <% if session[:credentials].role_id == 3 %>
    <td><%= link_to translate('Delete',@lang), {:controller=>'players', :action=>'delete', :id=>player}, :confirm=>translate('Are you sure?',@lang), :method=>:delete %></td>
    <td><%= link_to translate('Edit',@lang), {:controller=>'players', :action=>'edit', :id=>player} %></td>
    <% end %>
  </tr>
<% end %>
</table>

<% end %>
